﻿<%@ Page Language="C#" MasterPageFile="~/AdminMain.Master" AutoEventWireup="true"
    CodeBehind="Configure.aspx.cs" Inherits="BitlockerRecovery.AdminFaq"
    ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContentPlaceholder" runat="server">
    <asp:Menu ID="TopMenu" Width="168px" runat="server" Orientation="Horizontal" StaticEnableDefaultPopOutImage="False"
        OnMenuItemClick="TopMenu_MenuItemClick">
        <Items>
            <asp:MenuItem Text="Faq's " Value="0"></asp:MenuItem>
            <asp:MenuItem Text=" | Email " Value="1"></asp:MenuItem>
            <asp:MenuItem Text=" |Data Archival" Value="2"></asp:MenuItem>
        </Items>
    </asp:Menu>
    <asp:MultiView ID="Multiview1" runat="server" ActiveViewIndex="0">
        <asp:View ID="FaqTab" runat="server">
            <table class="TabTable">
                <tr valign="top">
                    <td class="TabArea">
                        <br />
                        <br />
                        <asp:GridView DataKeyNames="FaqID" OnRowCommand="FaqEdit_RowCommand" OnRowUpdating="FaqEdit_RowUpdating"
                            OnRowEditing="FaqEdit_RowEditing" OnRowCancelingEdit="FaqEdit_RowCancelingEdit"
                            OnRowDeleting="FaqEdit_RowDeleting" AutoGenerateColumns="false" ID="FaqEdit"
                            runat="server" AutoGenerateEditButton="false" AutoGenerateDeleteButton="false"
                            ShowFooter="true">
                            <Columns>
                                <asp:TemplateField HeaderText="Edit" ShowHeader="False">
                                    <EditItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                            Text="Update" ValidationGroup="vgEditFaq"></asp:LinkButton>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                            Text="Cancel"></asp:LinkButton>
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="True" CommandName="AddNew"
                                            Text="Add New" ValidationGroup="vgAddFaq"></asp:LinkButton>
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                            Text="Edit"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Delete" ShowHeader="false">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="Delete"></asp:LinkButton>
                                    </ItemTemplate>
                                    <%--<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" ShowHeader="True" />--%>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Faq Text" SortExpression="FaqText">
                                    <EditItemTemplate>
                                        <asp:TextBox CssClass="InputTextBox" Width="500" TextMode="MultiLine" Height="50"
                                            ID="txtEditFaq" runat="server" Text='<%# Eval("FaqText") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredGUID" runat="server" ControlToValidate="txtEditFaq"
                                            SetFocusOnError="true" ValidationGroup="vgEditFaq" ErrorMessage="Faq Text is a required field"
                                            Display="None"></asp:RequiredFieldValidator>
                                        <asp:ValidationSummary runat="server" ValidationGroup="vgEditFaq" HeaderText="Please correct the following:"
                                            ShowMessageBox="true" ID="valiEditFaq" ShowSummary="false" DisplayMode="BulletList" />
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox CssClass="InputTextBox" Width="500" TextMode="MultiLine" Height="50"
                                            ID="NewFaq" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredGUID" runat="server" ControlToValidate="NewFaq"
                                            SetFocusOnError="true" ValidationGroup="vgAddFaq" ErrorMessage="Faq Text is a required field"
                                            Display="None"></asp:RequiredFieldValidator>
                                        <asp:ValidationSummary runat="server" ValidationGroup="vgAddFaq" HeaderText="Please correct the following:"
                                            ShowMessageBox="true" ID="valiAddFaq" ShowSummary="false" DisplayMode="BulletList" />
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:Label CssClass="DisplayData" ID="Label4" runat="server" Text='<%#Microsoft.Security.Application.AntiXss.HtmlEncode(Eval("FaqText").ToString()) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="EmailTab" runat="server">
            <table class="TabTable">
                <tr valign="top">
                    <td class="TabArea">
                        <br />
                        <br />
                        <asp:Label CssClass="InfoLabel" runat="server">Select the email template:   </asp:Label><asp:ListBox
                            ID="TemplatesList" runat="server" Rows="1" DataTextField="NotificationType" DataValueField="NotificationID" />
                        <asp:Button CssClass="SubmitButton" ID="SelectEmail" OnClick="SelectEmail_OnClick"
                            Text="Submit" runat="server" /><br />
                        <br />
                        <table>
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:TextBox CssClass="InputTextBox" ID="txtNotificationID" runat="server" Visible="false"
                                                    ReadOnly="true"></asp:TextBox>
                                                <asp:Label CssClass="InfoLabel" runat="server">From: </asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox CssClass="InputTextBox" ID="txtFrom" runat="server" MaxLength="8"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredGUID" runat="server" ControlToValidate="txtFrom"
                                                    SetFocusOnError="true" ValidationGroup="vgEditEmail" ErrorMessage="From is a required field."
                                                    Display="None"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="InfoSubject" CssClass="InfoLabel" runat="server">Subject: </asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox Width="500" MaxLength="200" CssClass="InputTextBox" ID="txtSubject"
                                                    runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSubject"
                                                    SetFocusOnError="true" ValidationGroup="vgEditEmail" ErrorMessage="Subject is a required field."
                                                    Display="None"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top">
                                                <asp:Label ID="MessageLabel" CssClass="InfoLabel" runat="server">Message: </asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox Width="500" Height="500" TextMode="MultiLine" CssClass="InputTextBox"
                                                    ID="txtMessage" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtMessage"
                                                    SetFocusOnError="true" ValidationGroup="vgEditEmail" ErrorMessage="Message is a required field."
                                                    Display="None"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Button ID="PreviewEmail" OnClick="PreviewEmail_OnClick" CssClass="SubmitButton"
                                                    runat="server" Text="Preview" ValidationGroup="vgEditEmail" CausesValidation="true" />
                                            </td>
                                            <td>
                                                <asp:Button ID="SaveEmail" OnClick="SaveEmail_OnClick" ValidationGroup="vgEditEmail"
                                                    CausesValidation="true" CssClass="SubmitButton" runat="server" Text="Save" />
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:ValidationSummary runat="server" ValidationGroup="vgEditEmail" HeaderText="Please correct the following:"
                                        ShowMessageBox="true" ID="EditEmailValidationMessage" ShowSummary="false" DisplayMode="BulletList" />
                                </td>
                                <td class="TabArea">
                                    <asp:Literal ID="ltPreview" runat="server" Mode="Transform"></asp:Literal>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="ArchiveTab" runat="server">
            <table class="TabTable">
                <tr valign="top">
                    <td class="TabArea">
                        <br />
                        <br />
                        <asp:Label CssClass="InfoLabel" runat="server">Update the number of days before a record is archived.</asp:Label>
                        <asp:TextBox CssClass="InputTextBox" ID="txtDays" runat="server"></asp:TextBox>
                        <asp:Button CssClass="SubmitButton" Text="Submit" OnClick="ArchiveSubmit_OnClick"
                            runat="server" ValidationGroup="vgEditDays" CausesValidation="true" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDays"
                            SetFocusOnError="true" ValidationGroup="vgEditDays" ErrorMessage="Days is a required field."
                            Display="None"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator runat="server" ID="regexDays" ControlToValidate="txtDays"
                            ErrorMessage="Invalid Input: Archive Days" SetFocusOnError="true" ValidationGroup="vgEditDays"
                            ValidationExpression="^[0-9]+$" Display="None"></asp:RegularExpressionValidator>
                        <asp:ValidationSummary runat="server" ValidationGroup="vgEditDays" HeaderText="Please correct the following:"
                            ShowMessageBox="true" ID="ValidationSummary1" ShowSummary="false" DisplayMode="BulletList" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
